package test.controller;

import javax.annotation.Resource;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import test.mode.Account;
import test.service.IAccountService;

/**
 * @项目名称：lucene
 * @类名称：AccountController
 * @类描述：
 * @创建人：YangChao
 * @作者单位：北京宝库在线网络技术有限公司
 * @联系方式：YangChao@baoku.com
 * @创建时间：2016年8月30日 下午4:42:30
 * @version 1.0.0
 */
@Controller
@RequestMapping("/account")
public class AccountController {
	private static Logger logger = Logger.getLogger(AccountController.class);
	@Resource
	private IAccountService accountService;

	@RequestMapping("/showUser/{id}")
	public String showUser(Model model, @PathVariable("id") Integer id) {
		try {
			Account account = accountService.getAccountById(id);
			model.addAttribute("account", account);
		} catch (Exception e) {
			logger.error("AccountController.showUser", e);
		}
		return "showAccount";
	}
}
